/* 
 * File:   WindowCreator.h
 * Author: clems
 *
 * Created on May 19, 2013, 10:02 AM
 */

#ifndef WINDOWCREATOR_H
#define	WINDOWCREATOR_H

#include "screen.h"
#include "monitor.h"
#include "singleton.h"
#include <map>

class WindowCreator : public Singleton<WindowCreator> {
public:
    friend class Singleton<WindowCreator>;
    
    void attachDisplay(Display *d);
    WMWindow *create(Window window, WMScreen *screen, WMMonitor *monitor);
    WMWindow *get(Window window);
    void destroy(Window);
private:
    WindowCreator();
    virtual ~WindowCreator();
    
    
    struct WindowHierarchy
    {
        WMScreen *screen;
        WMMonitor *monitor;
        WMWindow *window;
    };
    
    std::map<Window, WindowHierarchy*> m_windows_map;
    Display *p_display;
};
    
#endif	/* WINDOWCREATOR_H */

